<template>
    <div>
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
          label="序号"
          type="index"
          width="50">
        </el-table-column>
        <el-table-column
          prop="createTime"
          width="160"
          label="交易时间">
        </el-table-column>
        <el-table-column
          prop="orderNo"
          label="订单号">
        </el-table-column>
        <el-table-column
          prop="price"
          label="订单金额">
        </el-table-column>
        <el-table-column
          prop="payMoney"
          label="实付金额">
        </el-table-column>
        <el-table-column
          prop="refundMoney"
          label="分账金额">
        </el-table-column>
        <el-table-column
          prop="status"
          label="订单状态">
          <template slot-scope="scope">
            <span>{{scope.row.status|changeOrderStatus}}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="refundStatus"
          label="分账状态">
          <template slot-scope="scope">
            <span>{{scope.row.refundStatus|changeRefundStatus}}</span>
          </template>
        </el-table-column>
      </el-table>
      <div class="paginationBox">
        <el-pagination
          :page-sizes="[10, 50, 100, 200]"
          :page-size.sync="queryParams.pageSize"
          :current-page.sync="queryParams.pageNum"
          @size-change="getRefundList"
          @current-change="getRefundList"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
      </div>
    </div>
</template>

<script>
  import {getRefundList} from  '@/api/separateAccounts'
  export default {
    name: 'separateTable',
    data(){
      return{
        tableData: [],
        total:0,
        queryParams:{
          pageSize:10,
          pageNum:1,
          refundType:""
        }
      }
    },
    props:{
      refundType:"",
      inviteeId:""
    },
    watch:{
      refundType(val){
        this.queryParams={
          pageSize:10,
          pageNum:1,
          refundType:val
        }
        this.getRefundList()
      },
      inviteeId(val){
        this.queryParams={
          pageSize:10,
          pageNum:1,
          inviteeId:val
        }
        this.getRefundList()
      }
    },
    filters:{


    },
    created() {
      this.getRefundList()
    },
    methods:{
      getRefundList(){
        let param={
          ...this.queryParams,
          "targetId":this.$route.query.id
        }
        getRefundList(param).then(res=>{
          if(res.code == 200){
            this.tableData = res.data.list
            this.total = res.data.total
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
